﻿<link rel="import" href="../../js/lib/polymer-v2.4.0-rc.1/polymer-element.html">
<link rel="import" href="../../js/lib/polymer-v2.4.0-rc.1/lib/elements/dom-repeat.html">

<dom-module id="employee-list">
	<template>
		<div> 雇员列表：</div>
		<p></p>
		<template is="dom-repeat" items="{{employees}}">
			<div>First name: <span>{{item.first}}</span></div>
			<div>Last name: <span>{{item.last}}</span></div>
			<p></p>
		</template>
	</template>
	<script>
		class EmployeeList extends Polymer.Element {
			static get is() {
				return "employee-list";
			}

			// 设置元素的雇员属物
			constructor() {
				super();
				this.employees = [{
						first: 'Bob',
						last: 'Li'
					},
					{
						first: 'Ayesha',
						last: 'Johnson'
					},
					{
						first: 'Fatma',
						last: 'Kumari'
					},
					{
						first: 'Tony',
						last: 'Mori'
					}, {
						first: 'Shawna',
						last: 'Williams'
					}
				];
			}
		}
		customElements.define(EmployeeList.is, EmployeeList);
	</script>

</dom-module>